﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace 第二课堂评审系统.Models
{
    public class PreliminaryConfig : IEntityTypeConfiguration<Preliminary>
    {
        public void Configure(EntityTypeBuilder<Preliminary> builder)
        {
            builder.ToTable("T_Preliminary");
            builder.Property(p=>p.classRoom).HasMaxLength(20);
            builder.HasMany(p => p.Partnars).WithOne(p=>p.preliminary);
            builder.HasMany(p => p.judgesList).WithOne(p=>p.JudgePre);
            builder.HasMany(p => p.Achievements).WithOne(p => p.Preliminary);
            builder.HasMany(p => p.JoinPartnars).WithOne(p => p.MyPreliminary);

        }
    }
}
